package com.qiujie.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.poi.ss.formula.functions.T;


@Getter
@AllArgsConstructor
public enum AttendanceStatusEnum implements BaseEnum<T> {
    // ============ 平级顶级节点（parentCode=null）============
    NORMAL(0, "正常","success", null, false),
    LATE(1, "迟到","warning", null, false),
    LEAVE_EARLY(2, "早退","warning", null, false),
    ABSENTEEISM(3, "旷工","danger", null, false),
    LEAVE(4, "公休","info", null, false),
    TIME_OFF(5,"调休","info", null, false),
    TRAINING(6, "培训", "success", null, false),
    FIELD_PERSONNEL(7, "特殊工种出勤/外勤", "success", null, false),
    PUBLIC_HOLIDAY(8, "法定节假日", "success", null, false),
    STAGGER_HOLIDAY(9, "轮休", "success", null, false),

    // ============ 正常（0）的子节点 ============
    ON_SURFACE(10, "井上", "success", 0, false),
    UNDERGROUND(11, "井下", "success", 0, false),

    // ============ 井上的子节点 ============
    ON_SURFACE_BIG_NIGHT_SHIFT(12, "井上大夜班", "success",10, false),
    ON_SURFACE_SMALL_NIGHT_SHIFT(13, "井上小夜班", "success",10, false),
    ON_SURFACE_BIG_DAY_SHIFT(14, "井上大白班", "success",10, false),
    ON_SURFACE_LITTLE_WHITE_SHIFT(15, "井上小白班", "success",10, false),

    // ============ 井下的子节点 ============
    UNDERGROUND_BIG_NIGHT(16, "井下大夜班", "success",11, false),
    UNDERGROUND_SMALL_NIGHT(17, "井下小夜班", "success",11, false),
    UNDERGROUND_BIG_DAY(18, "井下大白班", "success",11, false),
    UNDERGROUND_LITTLE_DAY(19, "井下小白班", "success",11, false),

    //请假
    PERSONAL_LEAVE(20, "事假","success",true),
    MATERNITY_LEAVE(21, "生育假","success",true),
    SICK_LEAVE(22, "病假","success",true),
    MARRIAGE_LEAVE(23, "婚假","success",true),
    HOME_LEAVE(24, "探亲假","success",true),
    PATERNITY_LEAVE(25, "陪待假","success",true),
    //ANNUAL_LEAVE(26,"年休假","success",true),
    WORKIN_JURY_LEAVE(27,"工伤","success",true),
    BEREAVEMENT_LEAVE(28,"丧假","success",true),
    ABORTION_LEAVE(29,"流产假","success",true),
    PREGNANCY_CHECK_UP_LEAVE(30,"孕期检查假","success",true),
    NURSING_LEAVE(31,"护理育儿假","success",true),
    BIRTH_CONTROL(32,"节育绝育假","success",true),
    BREASTFEEDING(33,"哺乳假","success",true);

    @EnumValue
    private final Integer code;
    @JsonValue
    private final String message;
    private final String tagType;
    private final boolean isAuto; // 新增字段
    private final Integer parentCode;//层级字段


    // ============ 构造方法 ============
    // 平级顶级节点构造方法（parentCode=null）
    AttendanceStatusEnum(Integer code, String message, String tagType, boolean isAuto) {
        this(code, message, tagType, null, isAuto);
    }

    // 带parentCode的构造方法
    AttendanceStatusEnum(Integer code, String message, String tagType, Integer parentCode, boolean isAuto) {
        this.code = code;
        this.message = message;
        this.tagType = tagType;
        this.parentCode = parentCode;
        this.isAuto = isAuto;
    }
}


/*@Getter
public enum AttendanceStatusEnum implements BaseEnum<T> {

    NORMAL(0, "正常","success"),
    LATE(1, "迟到","warning"),
    LEAVE_EARLY(2, "早退","warning"),
    ABSENTEEISM(3, "旷工","danger"),
    LEAVE(4, "公休","info"),
    TIME_OFF(5,"调休","info"),
    ON_SURFACE(6, "井上", "success"),
    UNDERGROUND(7, "井下", "success"),
    BIG_NIGHT_SHIFT(8, "大夜班", "success"),
    SMALL_NIGHT_SHIFT(9, "小夜班", "success"),
    TRAINING(10, "培训", "success"),
    FIELD_PERSONNEL(11, "特殊工种出勤/外勤", "success"),
    PUBLIC_HOLIDAY(12, "法定节假日", "success"),
    STAGGER_HOLIDAY(13, "轮休", "success"),
    BIG_DAY_SHIFT(14, "大白班", "success"),
    LITTLE_WHITE_SHIFT(15, "小白班", "success"),


    PERSONAL_LEAVE(20, "事假","success",true),
    MATERNITY_LEAVE(21, "生育假","success",true),
    SICK_LEAVE(22, "病假","success",true),
    MARRIAGE_LEAVE(23, "婚假","success",true),
    HOME_LEAVE(24, "探亲假","success",true),
    PATERNITY_LEAVE(25, "陪待假","success",true),
    ANNUAL_LEAVE(26,"年休假","success",true),
    WORKIN_JURY_LEAVE(27,"工伤","success",true),
    BEREAVEMENT_LEAVE(28,"丧假","success",true),
    ABORTION_LEAVE(29,"流产假","success",true),
    PREGNANCY_CHECK_UP_LEAVE(30,"孕期检查假","success",true),
    NURSING_LEAVE(31,"护理育儿假","success",true),
    BIRTH_CONTROL(32,"节育绝育假","success",true),
    BREASTFEEDING(33,"哺乳假","success",true);

    @EnumValue
    private final Integer code;
    @JsonValue
    private final String message;
    private final String tagType;
    private final boolean isAuto; // 新增字段

    // 默认isAuto=false的构造方法
    AttendanceStatusEnum(Integer code, String message, String tagType) {
        this(code, message, tagType, false);
    }

    // 全参数构造方法
    AttendanceStatusEnum(Integer code, String message, String tagType, boolean isAuto) {
        this.code = code;
        this.message = message;
        this.tagType = tagType;
        this.isAuto = isAuto;
    }

}*/

